using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class ICPurchaseEntryMap : EntityTypeConfiguration<ICPurchaseEntry>
    {
        public ICPurchaseEntryMap()
        {
            // Primary Key
            this.HasKey(t => t.FDetailID);

            // Properties
            this.Property(t => t.FBrNo)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FMapNumber)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FMapName)
                .HasMaxLength(256);

            this.Property(t => t.FNote)
                .HasMaxLength(255);

            this.Property(t => t.FBatchNo)
                .HasMaxLength(255);

            this.Property(t => t.FFreeItem1)
                .HasMaxLength(20);

            this.Property(t => t.FFreeItem2)
                .HasMaxLength(20);

            this.Property(t => t.FFreeItem3)
                .HasMaxLength(20);

            this.Property(t => t.FFreeItem4)
                .HasMaxLength(20);

            this.Property(t => t.FSourceBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FContractBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FOrderBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FHSUnit1_I)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FHSUnit2_I)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FMTONo)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("ICPurchaseEntry");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FEntryID).HasColumnName("FEntryID");
            this.Property(t => t.FDetailID).HasColumnName("FDetailID");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FQty).HasColumnName("FQty");
            this.Property(t => t.FPrice).HasColumnName("FPrice");
            this.Property(t => t.FAmount).HasColumnName("FAmount");
            this.Property(t => t.FTaxRate).HasColumnName("FTaxRate");
            this.Property(t => t.FTax).HasColumnName("FTax");
            this.Property(t => t.FTaxAmount).HasColumnName("FTaxAmount");
            this.Property(t => t.FAmountMust).HasColumnName("FAmountMust");
            this.Property(t => t.FAmountEx).HasColumnName("FAmountEx");
            this.Property(t => t.FCommitQty).HasColumnName("FCommitQty");
            this.Property(t => t.FDeductTax).HasColumnName("FDeductTax");
            this.Property(t => t.FUnitID).HasColumnName("FUnitID");
            this.Property(t => t.FAuxCommitQty).HasColumnName("FAuxCommitQty");
            this.Property(t => t.FAuxPrice).HasColumnName("FAuxPrice");
            this.Property(t => t.FAuxQty).HasColumnName("FAuxQty");
            this.Property(t => t.FTaxPrice).HasColumnName("FTaxPrice");
            this.Property(t => t.FAuxTaxPrice).HasColumnName("FAuxTaxPrice");
            this.Property(t => t.FSourceEntryID).HasColumnName("FSourceEntryID");
            this.Property(t => t.FMapNumber).HasColumnName("FMapNumber");
            this.Property(t => t.FMapName).HasColumnName("FMapName");
            this.Property(t => t.FOrgBillEntryID).HasColumnName("FOrgBillEntryID");
            this.Property(t => t.FOrderPrice).HasColumnName("FOrderPrice");
            this.Property(t => t.FAuxOrderPrice).HasColumnName("FAuxOrderPrice");
            this.Property(t => t.FNote).HasColumnName("FNote");
            this.Property(t => t.FAddCost).HasColumnName("FAddCost");
            this.Property(t => t.FAddCostFor).HasColumnName("FAddCostFor");
            this.Property(t => t.FStdAmount).HasColumnName("FStdAmount");
            this.Property(t => t.FStdTaxAmount).HasColumnName("FStdTaxAmount");
            this.Property(t => t.FDiscountRate).HasColumnName("FDiscountRate");
            this.Property(t => t.fauxqty_base).HasColumnName("fauxqty_base");
            this.Property(t => t.FBatchNo).HasColumnName("FBatchNo");
            this.Property(t => t.FCOMINVID).HasColumnName("FCOMINVID");
            this.Property(t => t.FAmountincludetax).HasColumnName("FAmountincludetax");
            this.Property(t => t.FStdAmountincludetax).HasColumnName("FStdAmountincludetax");
            this.Property(t => t.FEntryID_SRC).HasColumnName("FEntryID_SRC");
            this.Property(t => t.FClassID_SRC).HasColumnName("FClassID_SRC");
            this.Property(t => t.FFreeItem1).HasColumnName("FFreeItem1");
            this.Property(t => t.FFreeItem2).HasColumnName("FFreeItem2");
            this.Property(t => t.FFreeItem3).HasColumnName("FFreeItem3");
            this.Property(t => t.FFreeItem4).HasColumnName("FFreeItem4");
            this.Property(t => t.FAuxPropID).HasColumnName("FAuxPropID");
            this.Property(t => t.FAmtDiscount).HasColumnName("FAmtDiscount");
            this.Property(t => t.FStdAmtDiscount).HasColumnName("FStdAmtDiscount");
            this.Property(t => t.FPriceDiscount).HasColumnName("FPriceDiscount");
            this.Property(t => t.FAuxPriceDiscount).HasColumnName("FAuxPriceDiscount");
            this.Property(t => t.FsecCoefficient).HasColumnName("FsecCoefficient");
            this.Property(t => t.FSecQty).HasColumnName("FSecQty");
            this.Property(t => t.FQuantityReceive_Commit).HasColumnName("FQuantityReceive_Commit");
            this.Property(t => t.FQuantityPayApply_Commit).HasColumnName("FQuantityPayApply_Commit");
            this.Property(t => t.FSecUnitID).HasColumnName("FSecUnitID");
            this.Property(t => t.FAmountFor_Commit).HasColumnName("FAmountFor_Commit");
            this.Property(t => t.FAmount_Commit).HasColumnName("FAmount_Commit");
            this.Property(t => t.FPayApplyAmountFor).HasColumnName("FPayApplyAmountFor");
            this.Property(t => t.FPayApplyAmount).HasColumnName("FPayApplyAmount");
            this.Property(t => t.FPayApplyQuantity).HasColumnName("FPayApplyQuantity");
            this.Property(t => t.FAllAmount).HasColumnName("FAllAmount");
            this.Property(t => t.FSecCommitQty).HasColumnName("FSecCommitQty");
            this.Property(t => t.FSourceTranType).HasColumnName("FSourceTranType");
            this.Property(t => t.FSourceInterId).HasColumnName("FSourceInterId");
            this.Property(t => t.FSourceBillNo).HasColumnName("FSourceBillNo");
            this.Property(t => t.FContractInterID).HasColumnName("FContractInterID");
            this.Property(t => t.FContractEntryID).HasColumnName("FContractEntryID");
            this.Property(t => t.FContractBillNo).HasColumnName("FContractBillNo");
            this.Property(t => t.FOrderInterID).HasColumnName("FOrderInterID");
            this.Property(t => t.FOrderEntryID).HasColumnName("FOrderEntryID");
            this.Property(t => t.FOrderBillNo).HasColumnName("FOrderBillNo");
            this.Property(t => t.FAllHookQTY).HasColumnName("FAllHookQTY");
            this.Property(t => t.FAllHookAmount).HasColumnName("FAllHookAmount");
            this.Property(t => t.FCurrentHookQTY).HasColumnName("FCurrentHookQTY");
            this.Property(t => t.FCurrentHookAmount).HasColumnName("FCurrentHookAmount");
            this.Property(t => t.FStdAllHookAmount).HasColumnName("FStdAllHookAmount");
            this.Property(t => t.FStdCurrentHookAmount).HasColumnName("FStdCurrentHookAmount");
            this.Property(t => t.FSplitSecQty).HasColumnName("FSplitSecQty");
            this.Property(t => t.FNoMust).HasColumnName("FNoMust");
            this.Property(t => t.FSaleCommitQty).HasColumnName("FSaleCommitQty");
            this.Property(t => t.FSaleSecCommitQty).HasColumnName("FSaleSecCommitQty");
            this.Property(t => t.FCheckQty).HasColumnName("FCheckQty");
            this.Property(t => t.FRemainQty).HasColumnName("FRemainQty");
            this.Property(t => t.FRemainAmount).HasColumnName("FRemainAmount");
            this.Property(t => t.FCheckAmount).HasColumnName("FCheckAmount");
            this.Property(t => t.FRemainAmountFor).HasColumnName("FRemainAmountFor");
            this.Property(t => t.FCheckAmountFor).HasColumnName("FCheckAmountFor");
            this.Property(t => t.FGUID).HasColumnName("FGUID");
            this.Property(t => t.FLinkCheckAmountFor).HasColumnName("FLinkCheckAmountFor");
            this.Property(t => t.FLinkCheckAmount).HasColumnName("FLinkCheckAmount");
            this.Property(t => t.FLinkCheckQty).HasColumnName("FLinkCheckQty");
            this.Property(t => t.FImpHSEntryID).HasColumnName("FImpHSEntryID");
            this.Property(t => t.FHSID).HasColumnName("FHSID");
            this.Property(t => t.FSRCCountryID).HasColumnName("FSRCCountryID");
            this.Property(t => t.FMapID).HasColumnName("FMapID");
            this.Property(t => t.FImpHSAmount).HasColumnName("FImpHSAmount");
            this.Property(t => t.FImpExciseAmount).HasColumnName("FImpExciseAmount");
            this.Property(t => t.FImpHSUnitRate1).HasColumnName("FImpHSUnitRate1");
            this.Property(t => t.FImpHSUnitRate2).HasColumnName("FImpHSUnitRate2");
            this.Property(t => t.FVATAmount).HasColumnName("FVATAmount");
            this.Property(t => t.FPackUnitID).HasColumnName("FPackUnitID");
            this.Property(t => t.FPackCount).HasColumnName("FPackCount");
            this.Property(t => t.FPackType).HasColumnName("FPackType");
            this.Property(t => t.FGWeight).HasColumnName("FGWeight");
            this.Property(t => t.FNWeight).HasColumnName("FNWeight");
            this.Property(t => t.FCubage).HasColumnName("FCubage");
            this.Property(t => t.FHSUnit1_I).HasColumnName("FHSUnit1_I");
            this.Property(t => t.FHSUnit2_I).HasColumnName("FHSUnit2_I");
            this.Property(t => t.FInvoiceAmountFor).HasColumnName("FInvoiceAmountFor");
            this.Property(t => t.FInvoiceAmount).HasColumnName("FInvoiceAmount");
            this.Property(t => t.FInvoiceQty).HasColumnName("FInvoiceQty");
            this.Property(t => t.FInvLinkCheckAmountFor).HasColumnName("FInvLinkCheckAmountFor");
            this.Property(t => t.FInvLinkCheckAmount).HasColumnName("FInvLinkCheckAmount");
            this.Property(t => t.FInvLinkCheckQty).HasColumnName("FInvLinkCheckQty");
            this.Property(t => t.FPlanMode).HasColumnName("FPlanMode");
            this.Property(t => t.FMTONo).HasColumnName("FMTONo");
        }
    }
}
